# Contributor: Amelia Clarke <selene@perilune.dev>
# Maintainer: Amelia Clarke <selene@perilune.dev>
pkgname=brogue
pkgver=1.13
pkgrel=0
pkgdesc="Classic roguelike with streamlined game mechanics and tasteful visual design (community edition)"
url="https://sites.google.com/site/broguegame/"
arch="all"
license="AGPL-3.0-or-later"
depends="sdl2 sdl2_image"
makedepends="sdl2-dev sdl2_image-dev"
source="BrogueCE-$pkgver.tar.gz::https://github.com/tmewett/BrogueCE/archive/refs/tags/v$pkgver.tar.gz
	brogue
	brogue.desktop
	"
builddir="$srcdir"/BrogueCE-"$pkgver"
_datadir=/usr/share/"$pkgname"
options="!check" # test suite not included in tagged releases

build() {
	make DATADIR="$_datadir" RELEASE=YES
}

package() {
	install -Dm755 -t "$pkgdir"/usr/libexec/ "$builddir"/bin/brogue
	install -Dm755 -t "$pkgdir"/usr/bin/ "$srcdir"/brogue

	install -Dm644 -t "$pkgdir$_datadir" "$builddir"/bin/keymap.txt
	install -Dm644 -t "$pkgdir$_datadir"/assets/ "$builddir"/bin/assets/*

	install -Dm644 -t "$pkgdir"/usr/share/applications/ \
		"$srcdir"/brogue.desktop
	install -Dm644 -t "$pkgdir"/usr/share/pixmaps/"$pkgname".png \
		"$builddir"/bin/assets/icon.png
}

sha512sums="
87d10e0385dcafdb0337377ac6893247a546af3abbe92d1914bfdf4ed5747acc1d714f88d34646180e6fc87f96c4d2a61fd7f089699340fec19fa423886718a9  BrogueCE-1.13.tar.gz
edd4bf6d669cda50358de95030dc9372b81e2d953e3215013136213a9f890f2dfbcc9ac6b091b3f07c9d363f38e713bd121571aad5341adbaada273d6f87f854  brogue
a2d493b2a663ae8ddca479e2c420f83761057f0db55a14002edc85f4c594639fed3f76a0c74a0b52470312e3666a3f1e42522c872db1aec7c900a0f3fda30f01  brogue.desktop
"
